--make BaseClass available
DEFINE_BASECLASS("gamemode_base")

GM.Name = "Blood of the Hinterlands"
GM.Author = "http://steamcommunity.com/groups/bloodofthehinterlandsofficial"
GM.Email = "http://steamcommunity.com/groups/bloodofthehinterlandsofficial"
GM.Website = "http://steamcommunity.com/groups/bloodofthehinterlandsofficial"

DeriveGamemode("base")

include("sh_metaPlayer.lua")
include("sh_metaEnt.lua")

Attributes = {Footman, ManAtArms, Archer, Pheasant, Lord, Bandit, Militia, Magician}
Attributes.Footman = {STR = 5, PRD = 0, INT = 1, END = 4, WEP = 5, CFT = 2}
Attributes.ManAtArms = {STR = 6, PRD = 0, INT = 1, END = 5, WEP = 6, CFT = 2}
Attributes.Archer = {STR = 5, PRD = 0, INT = 1, END = 5, WEP = 4, CFT = 2}
Attributes.Pheasant = {STR = 3, PRD = 1, INT = 1, END = 2, WEP = 3, CFT = 5}
Attributes.Lord = {STR = 10, PRD = 0, INT = 1, END = 8, WEP = 8, CFT = 3}
Attributes.Bandit = {STR = 5, PRD = 0, INT = 1, END = 4, WEP = 4, CFT = 3}
Attributes.Militia = {STR = 5, PRD = 1, INT = 1, END = 4, WEP = 4, CFT = 3}
Attributes.Magician = {STR = 5, PRD = 0, INT = 2, END = 4, WEP = 5, CFT = 2}

PlayerClasses = {}
local oldregisterclass = player_manager.RegisterClass
function player_manager.RegisterClass(name, tbl, base)
	if(!table.HasValue(PlayerClasses, name)) then
		table.insert(PlayerClasses, name)
	end
	oldregisterclass(name, tbl, base)
end
function player_manager.GetPlayerClasses(arg)
	local tbl = {}
	if(arg) then --include baseclass
		tbl = PlayerClasses
	else
		for k,v in ipairs(PlayerClasses) do
			if(!string.find(string.lower(v), "base")) then
				table.insert(tbl, v)
			end
		end
	end
	return tbl
end

include("classes/BasePlayer.lua")
include("classes/Footman.lua")
include("classes/ManAtArms.lua")
include("classes/Archer.lua")
include("classes/Pheasant.lua")
include("classes/Lord.lua")
include("classes/Bandit.lua")
include("classes/Militia.lua")
include("classes/Magician.lua")